module.exports = app => {
  const { router, controller, middleware } = app;
  const { auth } = middleware;

  // 获取信息
  router.get('/menus/:id/form', auth(), controller.menu.menuForm);
  // 获取角色路由
  router.get('/menus/routes', auth(), controller.menu.permissionMenu);
  // 获取路由下拉选项
  router.get('/menus/options', auth(), controller.menu.optionsMenu);
  // 获取菜单树
  router.get('/menus', auth(), controller.menu.list);

  // 添加
  router.post('/menus', auth(), controller.menu.save);

  // 修改
  router.put('/menus/:id', auth(), controller.menu.save);

  // 删除
  router.delete('/menus', auth(), controller.menu.remove);
};
